Class PortSecurityImpl

All Implemented Interfaces:
IPCObject, PortSecurity, Process

public class PortSecurityImpl extends ProcessImpl implements PortSecurity
Information provided by the PKI file:

    \class PortSecurity
    
    \brief PortSecurity handles and manipulates port security on switch ports.
    
    \example network().getDevice("Switch0").getPort("FastEthernet0/1").getPortSecurity()
    
Author:
Auto-generated
  • Constructor Details

  • Method Details

    • isEnabled

      public boolean isEnabled()
      Information provided by the PKI file:
      
          \brief Returns true if port security is enabled, otherwise false.
          
          \return bool, true if port security is enabled, otherwise false.
          
              
      Specified by:
      isEnabled in interface PortSecurity
      Returns:
      boolean Returns a boolean
    • setEnabled

      public void setEnabled(boolean bEnable)
      Information provided by the PKI file:
      
          \brief Enables or disables port security.
          
          \param bEnable, true to enable port security, false to disable it.
          
              
      Specified by:
      setEnabled in interface PortSecurity
      Parameters:
      bEnable - Takes in a parameter of bEnable
    • setMaxMacNumber

      public boolean setMaxMacNumber(int max)
      Information provided by the PKI file:
      
          \brief Sets the port security max-mac-count.
          
          \param max, the port security max-mac-count value.
          
          \return bool, true if successful, otherwise false.
          
              
      Specified by:
      setMaxMacNumber in interface PortSecurity
      Parameters:
      max - Takes in a parameter of max
      Returns:
      boolean Returns a boolean
    • getMaxMacNumber

      public int getMaxMacNumber()
      Information provided by the PKI file:
      
          \brief Returns the port security max-mac-count.
          
          \return int, the port security max-mac-count value.
          
              
      Specified by:
      getMaxMacNumber in interface PortSecurity
      Returns:
      int Returns a int
    • getTotalMac

      public int getTotalMac()
      Information provided by the PKI file:
      
          \brief Returns the total number of MAC addresses.
          
          \return int, the total number of MAC addresses.
          
              
      Specified by:
      getTotalMac in interface PortSecurity
      Returns:
      int Returns a int
    • getViolationCount

      public int getViolationCount()
      Information provided by the PKI file:
      
          \brief Returns the number of violations.
          
          \return int, the number of violations.
          
              
      Specified by:
      getViolationCount in interface PortSecurity
      Returns:
      int Returns a int
    • getLastSourceMacVlan

      public Pair<MACAddress,Integer> getLastSourceMacVlan()
      Information provided by the PKI file:
      
          \brief Returns the last source MAC address and VLAN number.
          
          \return pair<mac, int>, the last source MAC address and VLAN number.
          
              
      Specified by:
      getLastSourceMacVlan in interface PortSecurity
      Returns:
      Pair<MACAddress, Integer> Returns a Pair<MACAddress, Integer>
    • setViolationMode

      public void setViolationMode(PortViolation type)
      Information provided by the PKI file:
      
          \brief Sets the violation mode.
          
          \param type,        the violation mode.
          Violation modes:    eShutdown = 0,
          eProtect = 1,
          eRestrict = 2
          
              
      Specified by:
      setViolationMode in interface PortSecurity
      Parameters:
      type - Takes in a parameter of type
    • addSecureMacEntry

      public boolean addSecureMacEntry(MACAddress macAddress, boolean isSticky)
      Information provided by the PKI file:
      
          \brief Adds a secure MAC address entry.
          
          \param macAddress, the MAC address to add.
          \param isSticky, true for sticky, false for not sticky.
          
          \return bool, true if successful, otherwise false.
          
              
      Specified by:
      addSecureMacEntry in interface PortSecurity
      Parameters:
      macAddress - Takes in a parameter of macAddress
      isSticky - Takes in a parameter of isSticky
      Returns:
      boolean Returns a boolean
    • removeSecureMacEntry

      public boolean removeSecureMacEntry(MACAddress macAddress)
      Information provided by the PKI file:
      
          \brief Removes the specified secure MAC address entry.
          
          \param macAddress, the MAC address to remove.
          
          \return bool, true if successful, otherwise false.
          
              
      Specified by:
      removeSecureMacEntry in interface PortSecurity
      Parameters:
      macAddress - Takes in a parameter of macAddress
      Returns:
      boolean Returns a boolean
    • getSecureMacCount

      public int getSecureMacCount()
      Information provided by the PKI file:
      
          \brief Returns the number of secure MAC addresses.
          
          \return int, the number of secure MAC addresses.
          
              
      Specified by:
      getSecureMacCount in interface PortSecurity
      Returns:
      int Returns a int
    • secureMacExist

      public boolean secureMacExist(MACAddress macAddress)
      Information provided by the PKI file:
      
          \brief Returns true if the specified secure MAC address exists, otherwise false.
          
          \param macAddress, the MAC address of interest.
          
          \return bool, true if the specified secure MAC address exists, otherwise false.
          
              
      Specified by:
      secureMacExist in interface PortSecurity
      Parameters:
      macAddress - Takes in a parameter of macAddress
      Returns:
      boolean Returns a boolean
    • getPort

      public Port getPort()
      Information provided by the PKI file:
      
          \brief Returns the switch port.
          
          \return Port, the Port object.
          
              
      Specified by:
      getPort in interface PortSecurity
      Returns:
      Port Returns a Port
    • isStickyOn

      public boolean isStickyOn()
      Information provided by the PKI file:
      
          \brief Returns true if sticky is enabled, otherwise false.
          
          \return bool, true if sticky is enabled, otherwise false.
          
              
      Specified by:
      isStickyOn in interface PortSecurity
      Returns:
      boolean Returns a boolean
    • setStickyflag

      public void setStickyflag(boolean isSticky)
      Information provided by the PKI file:
      
          \brief Enables or disables sticky.
          
          \param isSticky, true to enable sticky, false to disable it.
          
              
      Specified by:
      setStickyflag in interface PortSecurity
      Parameters:
      isSticky - Takes in a parameter of isSticky